package com.zzy.app.entity.lifecycle;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;


//@Scope("prototype")
@Component
public class Cat implements InitializingBean, DisposableBean {
    public Cat() {
        System.out.println("Cat-constructor...");
    }


    @Override
    public void destroy() throws Exception {
        System.out.println("Cat-destroy...");
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("Cat-afterPropertiesSet...");
    }

    @PostConstruct
    public void postConstruct() {
        System.out.println("Cat-postConstruct...");
    }

    @PreDestroy
    public void preDestroy() {
        System.out.println("Cat-preDestroy...");
    }
}
